Repository navigation
fix(notifications): workspace mark as read clears the chat alert on the phone - #33713
Conversation
Positioned chat alerts only retire with an explicit read naming their journal boundary; the workspace toggle sent pane keys alone.
|
No actionable comments were generated in the recent review.
|
ELI5
When an agent chat finishes, Orca can send an alert to your paired phone. Clicking "Mark as read" on the workspace row on the desktop cleared the dot, but the phone alert stayed. Now Mark as read clears the phone alert too, the same way opening the chat or marking it read in Activity already does.
What Changed
setWorkspaceUnreadByUseralso emits an explicit subject read (emitAgentSubjectReads(..., 'explicit')) for every pane whose marker it cleared. The existing chat attention bridge turns that into a dismiss carrying the journal boundary (the edge that lit the row, never a later one), plus the host acknowledgement. This retires:Why
Root cause: the workspace toggle was the only read path that never sent a structured read. Opening the chat (the on-screen auto-ack) and Activity/dashboard Mark as read (
acknowledgeAgents(..., 'explicit')) both go throughemitAgentSubjectReads. This reuses that same path instead of adding anything new.I didn't call
acknowledgeAgentsfrom the workspace toggle. It also writes Activity acknowledgement stamps and clears manual-unread turns, so marking a workspace read would start marking its Activity threads read. That's a separate product call.No overlap with #30900: that PR doesn't touch the slice or the subject-read capture/listener path.
Linked Issue
Linear STA-11936 (no GitHub issue).
Visual Proof
N/A: nothing changes on the desktop. The change is that the phone's tray alert is withdrawn, which needs a paired host and a phone running a real chat turn. The regression test covers the emitted read, and the downstream dismissal is the same chain Activity's Mark as read already uses.
Testing
Added a test showing workspace Mark as read emits an
explicitread for a cleared chat subject. It fails on main (expected [] to deeply equal ['explicit']) and passes with the fix.Ran
pnpm test src/renderer/src/store/slices/workspace-attention src/renderer/src/hooks/useReadOnScreenAttention.test.ts,check:code-quality:changedandcheck:react-doctor:changed.Not run: a live phone tray check, for the reasons under Visual Proof.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Renderer-only. One call added in
workspace-attention-slice.ts;removeAndDismissnow returns what it removed instead of a boolean.Agent skill upstream boundary
Notes
Still not covered (out of scope, pre-existing):
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)